#include "Server.h"

int main()
{
	
	bool success = car::initializeSockets();
	if( !success )
		return 0;
	car::Server server;
	car::ServerSessionMgr sessionMgr( &server );
	car::ReliableConnection connection;
	sessionMgr.setConnection( connection );
	server.setServerSessionMgr( sessionMgr );
	if( server.startServer() )
	{
		printf(" Server start! \n" );
	}
	char input = 0;
	while( true )
	{
		scanf("%c", &input );
		if( input == 'q' )
		{
			server.stopServer();
			break;
		}
		Sleep( 1 );

	}

	car::shutdownSockets();

	getchar();

	return 0;
}